import puppeteer from "../../../lib/puppeteer/puppeteer.js";

export class Fs extends plugin {
    constructor() {
        super({
            name: '[Fs]游戏菜单',
            dsc: '游戏菜单',
            event: 'message',
            priority: 1,
            rule: [
                { reg: /^(#|\/)?(种田|Fs)(模拟器)?(菜单|帮助|指令|命令)$/i, fnc: 'gameMenu' }
            ]
        })
    }

    async gameMenu(e) {
        const menuData = {
            title: "种田模拟器",
            subtitle: "休闲种田，快乐生活",
            sections: [
                {
                    title: "🌱 基础种植",
                    items: [
                        { name: "领取田地", desc: "新手玩家必做，获得初始田地和金币", example: "领取田地" },
                        { name: "种植作物", desc: "在指定格子种植，可选择施肥", example: "种植*1大蒜" },
                        { name: "收获作物", desc: "收获成熟的作物，指定格子号", example: "收获*1" },
                        { name: "一键种植", desc: "在所有空闲田地种植，支持施肥", example: "一键种植大蒜 施肥 普通化肥" },
                        { name: "一键收获", desc: "一次性收获所有成熟作物", example: "一键收获" }
                    ]
                },
                {
                    title: "💰 交易系统",
                    items: [
                        { name: "出售作物", desc: "出售指定数量作物换取金币", example: "出售作物 大蒜*1" },
                        { name: "一键出售", desc: "出售仓库中所有作物", example: "一键出售作物" },
                        { name: "添置农田", desc: "使用金币购买新的田地格子", example: "添置农田" },
                        { name: "购买化肥", desc: "购买化肥提升产量，可指定数量", example: "购买化肥 普通化肥*1" }
                    ]
                },
                {
                    title: "🌊 田地管理",
                    items: [
                        { name: "浇水", desc: "缩短生长时间，每格1小时CD", example: "浇水*1" },
                        { name: "一键浇水", desc: "给所有作物浇水，共享CD", example: "一键浇水" },
                        { name: "种植施肥", desc: "种植时使用化肥，提升产量", example: "种植*1大蒜 施肥 普通化肥" },
                        { name: "中途施肥", desc: "已种植作物补充施肥，效果减半", example: "施肥*1 普通化肥" },
                        { name: "一键施肥", desc: "对所有未施肥作物使用化肥", example: "一键施肥 普通化肥" }
                    ]
                },
                {
                    title: "📊 信息查询",
                    items: [
                        { name: "农田信息", desc: "查看所有田地状态和剩余时间", example: "农田信息" },
                        { name: "蔬菜列表", desc: "查看可种植作物及其详细信息", example: "蔬菜列表" },
                        { name: "蔬菜仓库", desc: "查看当前库存的所有作物数量", example: "蔬菜仓库" },
                        { name: "化肥商店", desc: "查看化肥种类、价格和效果", example: "化肥商店" },
                        { name: "化肥背包", desc: "查看已拥有的化肥数量", example: "化肥背包" },
                        { name: "农场信息", desc: "查看当前金币、经验值等信息", example: "农场信息" }
                    ]
                },
                {
                    title: "💡 游戏机制",
                    items: [
                        { name: "浇水效果", desc: "12h内-10%，12-24h-20%，24h以上-30%成熟时间", example: "浇水*1" },
                        { name: "化肥效果", desc: "普通+20%，高级+50%，特级+100%，中途使用减半", example: "化肥商店" },
                        { name: "批量操作", desc: "一键种植支持施肥，自动计算所需化肥数量", example: "一键种植大蒜 施肥 普通化肥" },
                        { name: "收获概率", desc: "1%概率5倍收获，9%概率2倍收获", example: "收获*1" },
                        { name: "经验机制", desc: "种植收获获得经验，解锁更多作物种类", example: "农场信息" }
                    ]
                }
            ]
        }

        const image = await puppeteer.screenshot('游戏菜单', {
            tplFile: 'plugins/Farming-Simulator/resources/html/gameMenu.html',
            info: menuData,
        })
        return e.reply(image)
    }
} 